Use the img accessible role for these.
Also update the documentation and add tests.
| `COLUMNHEADER` | The header of a column in a list or grid | - |
| `COMBOBOX` | A control that can be expanded to show a list of possible values to select | #GtkComboBox |
| `DIALOG` | A dialog that prompts the user to enter information or require a response | #GtkDialog and subclasses |
+| `IMG` | An image | #GtkImage, #GtkPicture |
| `PROGRESS_BAR` | An element that display progress | #GtkProgressBar |
| `RADIO` | A checkable input in a group of radio roles | #GtkRadioButton |
| `SCROLLBAR` | A graphical object controlling the scolling of content | #GtkScrollbar |
* @GTK_ACCESSIBLE_ROLE_GRID_CELL: Unused
* @GTK_ACCESSIBLE_ROLE_GROUP: Unused
* @GTK_ACCESSIBLE_ROLE_HEADING: Unused
- * @GTK_ACCESSIBLE_ROLE_IMG: Unused
+ * @GTK_ACCESSIBLE_ROLE_IMG: An image.
* @GTK_ACCESSIBLE_ROLE_INPUT: Unused
* @GTK_ACCESSIBLE_ROLE_LABEL: Unused
* @GTK_ACCESSIBLE_ROLE_LANDMARK: Unused
* GtkImage has a single CSS node with the name image. The style classes
* .normal-icons or .large-icons may appear, depending on the #GtkImage:icon-size
* property.
+ *
+ * # Accessibility
+ *
+ * GtkImage uses the #GTK_ACCESSIBLE_ROLE_IMG role.
*/
typedef struct _GtkImageClass GtkImageClass;
g_object_class_install_properties (gobject_class, NUM_PROPERTIES, image_props);
gtk_widget_class_set_css_name (widget_class, I_("image"));
+
+ gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_IMG);
}
static void
* # CSS nodes
*
* GtkPicture has a single CSS node with the name picture.
+ *
+ * # Accessibility
+ *
+ * GtkImage uses the #GTK_ACCESSIBLE_ROLE_IMG role.
*/
enum
g_object_class_install_properties (gobject_class, NUM_PROPERTIES, properties);
gtk_widget_class_set_css_name (widget_class, I_("picture"));
+ gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_IMG);
}
static void
--- /dev/null
+#include <gtk/gtk.h>
+
+static void
+image_role (void)
+{
+ GtkWidget *widget = gtk_image_new ();
+ g_object_ref_sink (widget);
+
+ gtk_test_accessible_assert_role (widget, GTK_ACCESSIBLE_ROLE_IMG);
+
+ g_object_unref (widget);
+}
+
+static void
+picture_role (void)
+{
+ GtkWidget *widget = gtk_picture_new ();
+ g_object_ref_sink (widget);
+
+ gtk_test_accessible_assert_role (widget, GTK_ACCESSIBLE_ROLE_IMG);
+
+ g_object_unref (widget);
+}
+
+int
+main (int argc, char *argv[])
+{
+ gtk_test_init (&argc, &argv, NULL);
+
+ g_test_add_func ("/a11y/image/role", image_role);
+ g_test_add_func ("/a11y/picture/role", picture_role);
+
+ return g_test_run ();
+}
{ 'name': 'button' },
{ 'name': 'checkbutton' },
{ 'name': 'dialog' },
+ { 'name': 'image' },
{ 'name': 'progressbar' },
{ 'name': 'scrollbar' },
{ 'name': 'separator' },